package demo4;

/**
 * @Author 12629
 * @Description：
 */
public class Test {


    public static void test1(Animal animal) {
        animal.eat();
    }

    public static void walk(IRunable runable) {
        runable.run();
    }

    public static void flying(IFlyable flyable) {
        flyable.fly();
    }

    public static void main(String[] args) {
        Bird bird = new Bird("小飞飞",3);
        Duck duck = new Duck("唐老鸭",9);
        flying(bird);
        flying(duck);
    }

    public static void main2(String[] args) {
        Dog dog = new Dog("旺财",10);
        Duck duck = new Duck("唐老鸭",9);

        walk(dog);
        walk(duck);

        walk(new Robot());

    }

    public static void main1(String[] args) {
        Dog dog = new Dog("旺财",10);
        Bird bird = new Bird("小飞飞",3);
        Duck duck = new Duck("唐老鸭",9);

        test1(dog);
        test1(bird);
        test1(duck);

    }
}
